﻿using Anke.SHManage.BLL;
using Anke.SHManage.Model;
using Anke.SHManage.MSSQLDAL;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace Anke.SHManage.Web.Areas.BB.Controllers
{
    public class AllDictionaryController : Controller
    {
        //
        // GET: /BB/AllDictionary/

        string eventDispatchCenterID = UserOperateContext.Current.Seesion_Dispatch_SubCenterID; //2020-11-22 zch 登录人所处急救中心
            
        public ActionResult Index()
        {
            return View();
        }
        /// <summary>
        /// 取人员姓名（调度员工作状态流水用）
        /// </summary>
        /// <returns></returns>
        [HttpPost]
        public ActionResult GetPersonName()
        {
            try
            {
                var list = new LSDAL().Get_LS_DDYGZZT_RYXM(eventDispatchCenterID);
                return Json(list);
            }
            catch (Exception)
            {
                return this.Json("");
            }
        }
        /// <summary>
        /// 取人员姓名（根据人员类型）
        /// </summary>
        /// <returns></returns>
        [HttpPost]
        public ActionResult GetPersonForType(string RoleID)
        {
            try
            {
                var list = new LSDAL().GetPersonForType(RoleID, eventDispatchCenterID);
                return Json(list);
            }
            catch (Exception)
            {
                return this.Json("");
            }
        }
        /// <summary>
        /// 取全部人员姓名和工号  2016-7-8 zch  (用于日报表非生产用车添加人员)
        /// </summary>
        /// <returns></returns>
        [HttpPost]
        public ActionResult GetAllPerson()
        {
            try
            {
                var list = new LSDAL().getAllPersonWorkID();
                return Json(list);
            }
            catch (Exception)
            {
                return this.Json("");
            }
        }

        //取分中心(统计流水表)
        [HttpPost]
        public ActionResult GetCenterName()
        {
            try
            {
                var list = new LSDAL().GetCenter(eventDispatchCenterID);
                return Json(list);
            }
            catch (Exception)
            {
                return this.Json("");
            }
        }
        //取分站（统计流水表）
        [HttpPost]
        public ActionResult GetSationName(string centerID)
        {
            try
            {
                //List<string> centerId = centerID.Split(',').ToList();

                var list = new LSDAL().GetStation(centerID, eventDispatchCenterID);
                return Json(list);
            }
            catch (Exception)
            {
                return this.Json("");
            }
        }
        //取要车性质 （呼救事件流水表）
        public ActionResult GetAlarmEventType()
        {
            try
            {


                var list = new LSDAL().GetAlarmEventType();
                return Json(list);
            }
            catch (Exception)
            {
                return this.Json("");
            }
        }
        //取车辆状态 （呼救事件流水表）
        [HttpPost]
        public ActionResult GetCarState()
        {
            try
            {


                var list = new LSDAL().GetCarState();
                return Json(list);
            }
            catch (Exception)
            {
                return this.Json("");
            }
        }
        ////取受理类型（受理记录流水表）
        //[HttpPost]
        //public ActionResult GetCallType()
        //{
        //    try
        //    {


        //        var list = new LSDAL().GetCallType();
        //        return Json(list);
        //    }
        //    catch (Exception)
        //    {
        //        return this.Json("");
        //    }
        //}
        //取分站（病历流水表）
        [HttpPost]
        public ActionResult GetStations()
        {
            try
            {


                var list = new LSDAL().GetStations(eventDispatchCenterID);
                return Json(list);
            }
            catch (Exception)
            {
                return this.Json("");
            }
        }
        //取病种分类（病历流水表）
        [HttpPost]
        public ActionResult GetDiseasesClassifications()
        {
            try
            {


                var list = new LSDAL().GetDiseasesClassifications();
                return Json(list);
            }
            catch (Exception)
            {
                return this.Json("");
            }
        }
        //取病历中的事件类型（救治措施统计表）
        public ActionResult GetPatientVersion()
        {
            try
            {

                string PatientVersion = "PatientVersion";
                var list = new M_DictionaryBLL().GetCheckBoxModel(PatientVersion);
                return Json(list);
            }
            catch (Exception)
            {
                return this.Json("");
            }
        }
        //取病情分类（病历流水表）
        [HttpPost]
        public ActionResult GetIllnessClassification()
        {
            try
            {


                var list = new LSDAL().GetIllnessClassification();
                return Json(list);
            }
            catch (Exception)
            {
                return this.Json("");
            }
        }
        //取病情预报（病历流水表）
        [HttpPost]
        public ActionResult GetIllnessForecast()
        {
            try
            {


                var list = new LSDAL().GetIllnessForecast();
                return Json(list);
            }
            catch (Exception)
            {
                return this.Json("");
            }
        }
        //取急救效果（病历流水表）
        [HttpPost]
        public ActionResult GetFirstAidEffect()
        {
            try
            {


                var list = new LSDAL().GetFirstAidEffect();
                return Json(list);
            }
            catch (Exception)
            {
                return this.Json("");
            }
        }
        //取病家合作度（病历流水表）
        [HttpPost]
        public ActionResult GetDiseaseCooperation()
        {
            try
            {


                var list = new LSDAL().GetDiseaseCooperation();
                return Json(list);
            }
            catch (Exception)
            {
                return this.Json("");
            }
        }
        //取事件类型（病历流水表）
        [HttpPost]
        public ActionResult GetEventType()
        {
            try
            {


                var list = new LSDAL().GetEventType();
                return Json(list);
            }
            catch (Exception)
            {
                return this.Json("");
            }
        }
        //取死亡类型
        [HttpPost]
        public ActionResult GetDeathCase()
        {
            try
            {


                var list = new LSDAL().GetDeathCase();
                return Json(list);
            }
            catch (Exception)
            {
                return this.Json("");
            }
        }
        //取死亡证明类型
        [HttpPost]
        public ActionResult GetDeathCertificate()
        {
            try
            {


                var list = new LSDAL().GetDeathCertificate();
                return Json(list);
            }
            catch (Exception)
            {
                return this.Json("");
            }
        }
        //取受理类型
        [HttpPost]
        public ActionResult GetAcceptType()
        {
            try
            {


                var list = new LSDAL().GetAcceptType();
                return Json(list);
            }
            catch (Exception)
            {
                return this.Json("");
            }
        }
        //取电话类型
        [HttpPost]
        public ActionResult GetCallType()
        {
            try
            {


                var list = new LSDAL().GetCallType();
                return Json(list);
            }
            catch (Exception)
            {
                return this.Json("");
            }
        }
        //取车辆状态类型
        [HttpPost]
        public ActionResult GetAmbulanceState()
        {
            try
            {


                var list = new LSDAL().GetAmbulanceState();
                return Json(list);
            }
            catch (Exception)
            {
                return this.Json("");
            }
        }
        //取角色类型
        [HttpPost]
        public ActionResult GetRole()
        {
            try
            {


                var list = new LSDAL().GetRole();
                return Json(list);
            }
            catch (Exception)
            {
                return this.Json("");
            }
        }

        //根据分站取车辆（统计流水表）
        [HttpPost]
        public ActionResult GetAmbulanceName(string stationID)
        {
            try
            {
                //List<string> centerId = centerID.Split(',').ToList();

                var list = new LSDAL().GetAmbulanceName(stationID, eventDispatchCenterID);
                return Json(list);
            }
            catch (Exception)
            {
                return this.Json("");
            }
        }
        /// <summary>
        /// 获取出车结果
        /// 刘爱青 20160922 add
        /// </summary>
        /// <returns></returns>
        [HttpPost]
        public ActionResult GetTaskResult()
        {
            try
            {
                List<CheckModelExt> list = new List<CheckModelExt>();
                CheckModelExt info = new CheckModelExt();
                info.ID = "True";
                info.Name = "正常完成";
                list.Add(info);
                info = new CheckModelExt();
                info.ID = "False";
                info.Name = "异常结束";
                list.Add(info);
                return Json(list);
            }
            catch (Exception)
            {
                return this.Json("");
            }
        }
        /// <summary>
        /// 异常结束原因
        /// 刘爱青 20160922 add
        /// </summary>
        /// <returns></returns>
        [HttpPost]
        public ActionResult GetTaskReason()
        {
            try
            {
                var list = new LSDAL().GetTaskReason();
                return Json(list);
            }
            catch (Exception)
            {
                return this.Json("");
            }
        }
        //取药品名称
        [HttpPost]
        public ActionResult GetDrugName()
        {
            try
            {
                var list = new LSDAL().GetDrugName();
                return Json(list);
            }
            catch (Exception)
            {
                return this.Json("");
            }
        }

        //国籍
        [HttpPost]
        public ActionResult GetNational()
        {
            try
            {
                var list = new LSDAL().GetNational();
                return Json(list);
            }
            catch (Exception)
            {
                return this.Json("");
            }
        }

        //民族
        [HttpPost]
        public ActionResult GetFolk()
        {
            try
            {
                var list = new LSDAL().GetFolk();
                return Json(list);
            }
            catch (Exception)
            {
                return this.Json("");
            }
        }

        //年龄
        [HttpPost]
        public ActionResult GetAge()
        {
            try
            {
                var list = new AcceptEventDAL().GetAge();
                return Json(list);
            }
            catch (Exception)
            {
                return this.Json("");
            }
        }

        //事件来源
        [HttpPost]
        public ActionResult GetEventSource()
        {
            try
            {
                var list = new LSDAL().GetEventSource();
                return Json(list);
            }
            catch (Exception)
            {
                return this.Json("");
            }
        }

        //区域
        [HttpPost]
        public ActionResult GetArea()
        {
            try
            {
                var list = new LSDAL().GetArea();
                return Json(list);
            }
            catch (Exception)
            {
                return this.Json("");
            }
        }

        //病情 add2022-12-20 plq
        [HttpPost]
        public ActionResult GetTZIllState()
        {
            try
            {
                var list = new LSDAL().GetTZIllState();
                return Json(list);
            }
            catch (Exception)
            {
                return this.Json("");
            }
        }

        //事故类型
        [HttpPost]
        public ActionResult GetAccidentType()
        {
            try
            {
                var list = new LSDAL().GetAccidentType();
                return Json(list);
            }
            catch (Exception)
            {
                return this.Json("");
            }
        }

        //事故等级
        [HttpPost]
        public ActionResult GetAccidentLevel()
        {
            try
            {
                var list = new LSDAL().GetAccidentLevel();
                return Json(list);
            }
            catch (Exception)
            {
                return this.Json("");
            }
        }

        //取任务类型（任务流水表） 2016-12-09 周志猛
        [HttpPost]
        public ActionResult GetTaskType()
        {
            try
            {


                var list = new LSDAL().GetTaskType();
                return Json(list);
            }
            catch (Exception)
            {
                return this.Json("");
            }
        }

        //取伤病程度（任务流水表） 2016-12-09 周志猛
        [HttpPost]
        public ActionResult GetIllLevel()
        {
            try
            {


                var list = new LSDAL().GetIllLevel();
                return Json(list);
            }
            catch (Exception)
            {
                return this.Json("");
            }
        }

        //取特殊要求（任务流水表） 2016-12-09 周志猛
        [HttpPost]
        public ActionResult GetSpecialRequest()
        {
            try
            {


                var list = new LSDAL().GetSpecialRequest();
                return Json(list);
            }
            catch (Exception)
            {
                return this.Json("");
            }
        }

        //取地址类别（任务流水表） 2016-12-09 周志猛
        [HttpPost]
        public ActionResult GetLocalType()
        {
            try
            {


                var list = new LSDAL().GetLocalType();
                return Json(list);
            }
            catch (Exception)
            {
                return this.Json("");
            }
        }

        //取人员类型 2016-12-18 周志猛
        [HttpPost]
        public ActionResult GetPersonType()
        {
            try
            {


                var list = new LSDAL().GetPersonType();
                return Json(list);
            }
            catch (Exception)
            {
                return this.Json("");
            }
        }

        //取医院 2016-12-18 周志猛
        [HttpPost]
        public ActionResult GetHospital()
        {
            try
            {


                var list = new LSDAL().GetHospital(eventDispatchCenterID);
                return Json(list);
            }
            catch (Exception)
            {
                return this.Json("");
            }
        }

        //取呼救类型
        [HttpPost]
        public ActionResult GetHelpType()
        {
            try
            {


                var list = new LSDAL().GetHelpType();
                return Json(list);
            }
            catch (Exception)
            {
                return this.Json("");
            }
        }
    }
}
